package com.burst.reptile.framework.config;

import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;

/**
 * 错误页面
 * 
 * @author wujin
 *
 * @date: 2020年6月21日 下午4:57:57
 */
@Configuration
public class ErrorPageConfig implements ErrorPageRegistrar {

	@Override
	public void registerErrorPages(ErrorPageRegistry errorPageRegistry) {

		errorPageRegistry.addErrorPages(
			new ErrorPage(HttpStatus.NOT_FOUND, "/404"),
			new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500")
		);
	}
}
